<script setup lang="ts">
import {useRoute} from "vue-router";
// 使用useRoute()接收query字符串参数
const route =useRoute() // 获取路由对象
console.log(route.params.keyword)
console.log(route.params.page)
</script>

<template>
  <div class="search">
    <div>搜索页面组件2</div>
    <p>搜索关键词：{{ route.params.keyword}}</p>
    <p>当前⻚码：{{ route.params.page}}</p>
  </div>
</template>

<style scoped>

</style>
